const express = require("express");
const router = express.Router();
const { Pool } = require("pg");
const config = require("../config/config.json");
const pool = new Pool(config);
router.get("/", async function (req, res, next) {
  // xxx.insert(app.db,{})
  console.time('test')
  const client = await  pool.connect();

  const ret = await client.query("select * from users");
  let data = ret.rows;

  client.release();
  console.log(data);
  console.timeEnd('test')
  res.render("index", { title: "hello" ,users:data});
});

module.exports =   router;
 